
//预览跟踪点图片
function getView(obj){
	var pagePath = path;
	var resourcePath = $("#resourcePath").val();
	var url = pagePath + "/pig/cleanPipeLineTrack/getViewImg.json";
	//任务Id
	var taskId = convertObjectToString($("#taskId").val());
	//追踪点Id
	var pointId = convertObjectToString($(obj).parent().next().val());
	if("" == taskId || "" == pointId){
		alert("没有获取有效数据，请刷新页面重试");
		return;
	}else{
		$.ajax({
			url:url,
			data:{"taskId":taskId,"pointId":pointId},
			dataType:"json",
			type:"post",
			success:function(data){
			    $(".right-extra").children().html("");
			    var html ="";
				var imgList = data.result.imgList;
				var oneImg = data.result.oneImg;
				if(null != oneImg && undefined != oneImg){
					html += "<div id='preview' class='spec-preview' >" +
					"<span class='jqzoom'><img  style='width:350px;height: 350px;' jqimg='"+oneImg+"' src='"+oneImg+"' /></span>" +
					"</div>";
					html += "<div class='spec-scroll'> <a class='prev'>&lt;</a> <a class='next'>&gt;</a>" +
					"<div class='items'>" +
					"<ul>";
					if(imgList.length > 0){
						$.each(imgList,function(i,evalue){
							html += "<li><img  alt='' bimg='' src='"+evalue.path+"' onmousemove='preview(this);'></li>" ;
						});
						
					}
					html +="</ul>" +
					"</div>" +
					"</div>";
				}else{
					html += "<div class='no-data '><img src='"+resourcePath+"/images/pig/no-data.png' alt=''/></div>";
				}
				
				$(".right-extra").children().html(html);
				
				$("#viewImg").modal("show");
				$(".right-extra").show();
				pointImgView();
			}
		});
	}
}

function convertObjectToString(obj){
    return null==obj || "" == $.trim(obj) ? "" : obj;
}

function pigview(obj){
	var dimg = $("#pigview").children("img");
	dimg.attr("src",$(obj).attr("src"));
	$("#pigview").modal("show");
}